<template>
  <!--使用验证-->
  <div class="shoukuan">
    <div class="saocontent" @click="showScan()">
      <img src="../../assets/sao.png" alt="" width="85">扫一扫使用验证
    </div>
    <router-link to="/shuziyanzheng">
      <wv-button type="default" :mini="true" class="shuzi">数字码使用验证</wv-button>
    </router-link>
    <router-link to="/jilu">
      <wv-button type="default" :mini="true" class="jilu">使用验证记录</wv-button>
    </router-link>
    <router-link to="/addCheck">
      <wv-button type="default" :mini="true" class="check">核验增减</wv-button>
    </router-link>
    <div class="des">
      <p class="title">使用说明</p>
      <ul>
        <li><p>第一种 </p>1.点击“扫一扫使用验证”——扫描会员出示的要使用的相应服务对应的二维码</li>
        <li><p>第二种 </p>1.点击“数字码使用验证”——输入会员出示的要使用的相应服务对应的二维码下方的数字码。</li>
      </ul>
    </div>
  </div>
</template>

<script type="text/ecmascript-6">
  import {checkAccountGoods} from '../../../test/unit/http'
  import {wxApi} from '../../../test/unit/flyme_weixin'
  import {Toast} from 'we-vue'

  export default {
    name: '',
    props: {},
    data() {
      return {};
    },
    methods: {
      showScan() {
        let that = this;
        that.$router.push("scan")
      },
      getData(params) {
        checkAccountGoods(params).then(res => {
          console.log(res);
          if (res.code === 100) {
            let accountGoods = res.object;
            if (accountGoods.isVipCard == 1) {
              this.$router.push({name: 'yanzheng', query: {'accountGoodsId': accountGoods.accountGoodsId}})
            } else {
              this.$router.push({name: 'danci', query: {'accountGoodsId': accountGoods.accountGoodsId}})
            }
          } else {
            Toast.fail(res.info);
          }
        })
      }
    },
    created() {
      wxApi.init();
    },
    components: {}
  }
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped lang="less" rel="stylesheet/less">
  .des {
    background-color: rgba(255, 255, 255, 0.6);
    border-radius: 5px;
    padding: 20px 10px;
    margin: auto;
    margin-top: 15px;

    .title {
      font-size: 20px;
      color: #f98e3c;
      margin-bottom: 10px;
    }

    ul {
      li {
        color: #666;
        font-size: 15px;
        line-height: 25px;
        text-align: left;

        p {
          color: #111;
        }
      }

    }
  }

  button {
    height: 50px;
    line-height: 50px;
    font-size: 17px;
    width: calc(50% - 10px);
    margin-top: 15px;
  }

  .shuzi {
    color: #f98e3c;
    margin-right: 15px;
  }

  .jilu {
    border: 1px solid #fff;
    color: #f98e3c;
  }

  .check {
    color: #f98e3c;
    margin-right: 15px;
  }

  .shoukuan {
    background-image: linear-gradient(to right, #fea538, #f27140);
    height: 100vh;
    padding: 20px 10px;
  }

  .saocontent {
    background-color: #fff;
    border-radius: 5px;
    margin: auto;
    padding: 20px;
    text-align: left;
    font-size: 18px;
    color: #f98e3c;

    img {
      margin-right: 35px;
      vertical-align: middle;
    }
  }
</style>
